Skip to content

Add Azure DevOps support#125

Merged
ljtill merged 36 commits intoAzure:mainfrom
ljtill:feat/azdevops
Aug 6, 2020
Merged

Add Azure DevOps support#125
ljtill merged 36 commits intoAzure:mainfrom
ljtill:feat/azdevops

Conversation

@ljtill
Copy link
Copy Markdown
Member

@ljtill ljtill commented Aug 4, 2020

Per PR (#19):

This change has been borne of customer requirements, they have an existing investment in ADO and do not wish to migrate to GH Enterprise.

@liamfoneill and @matt-FFFFFF have jointly worked on this capability.

This PR should be considered in conjunction with the corresponding change to the Enterprise-Scale repo Azure/Enterprise-Scale#22

Change summary:

AzOps Pull Use git reset --hard origin/main to reset system branch, then force push. This is to fix a bug where the system branch already existed and main did not contain a ./azops directory. In this case there would be no changes from system->main so the PR would not be created.

Action Introduce a input called SCMPlatform - this is set to GitHub by default and does not change any functionality in the GitHub workflow. switch statements are used where the PowerShell calls out to the APIs for creating PRs, PR comments, etc.

ADO Implementation
The ADO pipeline works by pulling the AzOps Docker image from a registry. Additional environment variables are used to pass in required information and to make the container function in ADO.

We know ADO is not the priority at the moment, but we are in the situation where we have to support our customer. Keeping this ADO solution in sync with the upstream repo will be very time consuming and this PR means we don't have to be refreshing our code to keep up to date.

Conversely, we believe that this does not introduce significant ongoing maintenance work for the maintainers of this repo.

matt-FFFFFF and others added 20 commits July 16, 2020 17:21
* AzOps pipeline

[skip ci]

* Move pipeline

* Merged PR 20: Use ADO APIs

Related work items: #85, #86, #87, #88

* Merged PR 21: Revert 'Use ADO APIs'

Reverts !20

* Ado (#2)

* Reset AzOps pipeline

* Merged PR 18: Support for SCMPlatform

Prepares the ground for working with ADO

Related work items: #85

* Merged PR 19: AzOps-ContainerBuildAndPush

Related work items: #86

* Use ADO APIs to raise PRs/comments/labels

* remove unused var

* Update *.parameters.json location (#7)

* Update *.parameters.json location

* Update ubuntu-latest.yml

* Update ubuntu-latest.yml

* Update ubuntu-latest.yml

* Update AzOpsDockerBuild.yml for Azure Pipelines

* Update AzOpsDockerBuild.yml for Azure Pipelines

* Devug azure creds

* Update AzOpsDockerBuild.yml for Azure Pipelines

* Remove debugging

* debugthisshiz

* Update triggers

* debug git

* is git installed?

* moar

* Remove debugging

* Enable parallel jobs in pipeline (#10)

* Update pipeline to allow parallel test runs

* Add variables for important values

* Added dependsOn for 2nd stage jobs

* Update timeoutInMinutes variable

* Remove quotes from PSVersionTable

* Move environment configuration to script

* Move Initialize-AzOpsTestEnvironment to /test/scripts/ folder

* Add query params for get PR

* Add verbose output

* Add token output

* Change git merge to git reset

* Add force push

* Move token output outside if block

* Attempt response.count for REST response

* Add active check for PR query

* removing azops reference folder (#12)

* removing azopsreference

* changing variable name to AzOpsReferenceFolder

* changing Write-Ouput to Write-AzOpsLog

* adding AzOps Log

* Move pipeline

* Reset AzOps pipeline

* AzOps pipeline

[skip ci]

* Merged PR 18: Support for SCMPlatform

Prepares the ground for working with ADO

Related work items: #85

* Merged PR 19: AzOps-ContainerBuildAndPush

Related work items: #86

* Use ADO APIs to raise PRs/comments/labels

* remove unused var

* Update AzOpsDockerBuild.yml for Azure Pipelines

* Update AzOpsDockerBuild.yml for Azure Pipelines

* Devug azure creds

* Update AzOpsDockerBuild.yml for Azure Pipelines

* Remove debugging

* debugthisshiz

* Update triggers

* debug git

* is git installed?

* moar

* Remove debugging

* Add query params for get PR

* Add verbose output

* Add token output

* Change git merge to git reset

* Add force push

* Move token output outside if block

* Attempt response.count for REST response

* Add active check for PR query

* removing stong type from save-azopsmg (#13)

* Update container tag

* Moar variables

* Create ado specific comment

* Add replaceme tags

Co-authored-by: Matt White <mawhi@microsoft.com>
Co-authored-by: Matt White <Matthew.White@microsoft.com>
Co-authored-by: Lyon J Till <158992+ljtill@users.noreply.github.com>
Co-authored-by: Kevin Rowlandson <kevin.rowlandson@monoconsultancy.com>
Co-authored-by: uday31in <14359777+uday31in@users.noreply.github.com>

* AzOps pipeline

[skip ci]

* Move pipeline

* Merged PR 20: Use ADO APIs

Related work items: #85, #86, #87, #88

* Merged PR 21: Revert 'Use ADO APIs'

Reverts !20

* Ado (#2)

* Reset AzOps pipeline

* Merged PR 18: Support for SCMPlatform

Prepares the ground for working with ADO

Related work items: #85

* Merged PR 19: AzOps-ContainerBuildAndPush

Related work items: #86

* Use ADO APIs to raise PRs/comments/labels

* remove unused var

* Update *.parameters.json location (#7)

* Update *.parameters.json location

* Update ubuntu-latest.yml

* Update ubuntu-latest.yml

* Update ubuntu-latest.yml

* Update AzOpsDockerBuild.yml for Azure Pipelines

* Update AzOpsDockerBuild.yml for Azure Pipelines

* Devug azure creds

* Update AzOpsDockerBuild.yml for Azure Pipelines

* Remove debugging

* debugthisshiz

* Update triggers

* debug git

* is git installed?

* moar

* Remove debugging

* Enable parallel jobs in pipeline (#10)

* Update pipeline to allow parallel test runs

* Add variables for important values

* Added dependsOn for 2nd stage jobs

* Update timeoutInMinutes variable

* Remove quotes from PSVersionTable

* Move environment configuration to script

* Move Initialize-AzOpsTestEnvironment to /test/scripts/ folder

* Add query params for get PR

* Add verbose output

* Add token output

* Change git merge to git reset

* Add force push

* Move token output outside if block

* Attempt response.count for REST response

* Add active check for PR query

* removing azops reference folder (#12)

* removing azopsreference

* changing variable name to AzOpsReferenceFolder

* changing Write-Ouput to Write-AzOpsLog

* adding AzOps Log

* Move pipeline

* Reset AzOps pipeline

* AzOps pipeline

[skip ci]

* Merged PR 18: Support for SCMPlatform

Prepares the ground for working with ADO

Related work items: #85

* Merged PR 19: AzOps-ContainerBuildAndPush

Related work items: #86

* Use ADO APIs to raise PRs/comments/labels

* remove unused var

* Update AzOpsDockerBuild.yml for Azure Pipelines

* Update AzOpsDockerBuild.yml for Azure Pipelines

* Devug azure creds

* Update AzOpsDockerBuild.yml for Azure Pipelines

* Remove debugging

* debugthisshiz

* Update triggers

* debug git

* is git installed?

* moar

* Remove debugging

* Add query params for get PR

* Add verbose output

* Add token output

* Change git merge to git reset

* Add force push

* Move token output outside if block

* Attempt response.count for REST response

* Add active check for PR query

* removing stong type from save-azopsmg (#13)

* Update container tag

* Moar variables

* Create ado specific comment

* Add replaceme tags

Co-authored-by: Matt White <mawhi@microsoft.com>
Co-authored-by: Matt White <Matthew.White@microsoft.com>
Co-authored-by: Lyon J Till <158992+ljtill@users.noreply.github.com>
Co-authored-by: Kevin Rowlandson <kevin.rowlandson@monoconsultancy.com>
Co-authored-by: uday31in <14359777+uday31in@users.noreply.github.com>

* title & & body for ADO PR

* Remove INPUT prefix from SCMPLATFORM variable name

* Use  $(Build.SourceBranchName) for docker tag

* Updated AzOpsDockerBuild.yml

* Fix env var name

* Update AzOpsDockerBuild.yml for Azure Pipelines

* Update AzOpsDockerBuild.yml for Azure Pipelines

* Add replaceme tags

* Correct GH references

* Remove as this is now included upstream

* Remove explicit -Verbose

* Add Out-Nulls to REST requests

* Remove null redirects

Co-authored-by: Matt White <Matthew.White@microsoft.com>
Co-authored-by: Matt White <mawhi@microsoft.com>
Co-authored-by: Lyon J Till <158992+ljtill@users.noreply.github.com>
Co-authored-by: Kevin Rowlandson <kevin.rowlandson@monoconsultancy.com>
Co-authored-by: uday31in <14359777+uday31in@users.noreply.github.com>
@ljtill ljtill added the enhancement New feature or request label Aug 4, 2020
@ljtill ljtill added this to the Release - v0.5 milestone Aug 4, 2020
@ljtill ljtill requested a review from daltondhcp as a code owner August 4, 2020 20:55
@ljtill ljtill requested a review from uday31in August 4, 2020 20:57
uday31in
uday31in previously approved these changes Aug 4, 2020
@uday31in
Copy link
Copy Markdown
Member

uday31in commented Aug 4, 2020

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ljtill ljtill added the do-not-merge Not ready to merge label Aug 4, 2020
Comment thread src/public/Invoke-AzOpsGitPush.ps1
@ljtill ljtill removed the do-not-merge Not ready to merge label Aug 6, 2020
@ljtill
Copy link
Copy Markdown
Member Author

ljtill commented Aug 6, 2020

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@uday31in
Copy link
Copy Markdown
Member

uday31in commented Aug 6, 2020

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ljtill
Copy link
Copy Markdown
Member Author

ljtill commented Aug 6, 2020

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ljtill ljtill merged commit c7723f2 into Azure:main Aug 6, 2020
@ljtill ljtill deleted the feat/azdevops branch August 6, 2020 19:47
@ljtill ljtill removed the enhancement New feature or request label Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants